package Year22_Month02.day0226;

import java.util.Scanner;

public class Main {
    public static void main1(String[] args) {

        Scanner sc = new Scanner(System.in);
        String s1 = sc.nextLine();
        String s2 = sc.next();
        int L = s1.length();
        int count = 0;
        System.out.println(s1.substring(0,L) + s2 + s1.substring(L,L));
        for(int i = 0;i < L;i++) {
            StringBuffer s = new StringBuffer(s1.substring(0, i) + s2 + s1.substring(i, L));
            String res1 = s.toString();
            String res2 = s.reverse().toString();
            if (res2.equals(res1)) {
                count++;
            }
        }
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        System.out.println(StrToInt(s));
    }
    public static int StrToInt(String str){
        char[] arr = str.toCharArray();
        int l = arr.length;
        int res = 0;
        for (int i = l-1; i >= 0; i--) {
            int a = 0;
            switch (arr[i]){
                case '1':
                    a = 1;
                    break;
                case '2':
                    a = 2;
                    break;
                case '3':
                    a = 3;
                    break;
                case '4':
                    a = 4;
                    break;
                case '5':
                    a = 5;
                    break;
                case '6':
                    a = 6;
                    break;
                case '7':
                    a = 7;
                    break;
                case '8':
                    a = 8;
                    break;
                case '9':
                    a = 9;
                    break;
                case '-':
                    return -res;
                case '+':
                    return res;
                default:
                    return 0;
            }
            res += Math.pow(10, l - (i + 1)) * a;
        }
        return res;
    }
}
